﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Core;
using SharedGenomics.Annotations;

namespace SharedGenomics.Workbench.Annotations
{
    public class AnnotationKeyDependencyNode
    {
        private readonly AnnotationKey _value;
        private readonly IList<AnnotationKeyDependencyNode> _children;

        public AnnotationKeyDependencyNode(AnnotationKey key)
        {
            key.ThrowIfNull("key");

            this._children = new List<AnnotationKeyDependencyNode>();
            this._value = key;
        }

        public void AddChild(AnnotationKeyDependencyNode child)
        {
            child.ThrowIfNull("child");
            this._children.Add(child);
        }

        public AnnotationKey Value
        {
            get { return this._value; }
        }

        public AnnotationKeyDependencyNode Parent { get; internal set; }

        public IEnumerable<AnnotationKeyDependencyNode> Children
        {
            get { return this._children.AsEnumerable(); }
        }
    }
}
